function [u_slts] = Function_DMRS_u_slots(Mode, Hopping, n_ID, NCellID, SeqGroup)
    % u_slots Generate the sequence of base indices (u) when Group hopping is enabled
    % Outputs:     u_slts                   - seq. of base seq. numbers
    % Spec:        3GPP TS 36.211 section 5.5.1.3 v13.0.0

% 	NSLID;              % virtual cell ID for PSBCH (relevant for 'psbch_X' Mode)
%     NSAID;              % ??? virtual cell ID for PSBCH modes 1, 2 (relevant for 'psbch_mode1' or 'psbch_mode2' Mode)
%     NXID;               % ??? virtual cell ID for PSBCH modes 3, 4 (relevant for 'psbch_mode3' or 'psbch_mode4' Mode)    
    
    switch Mode
        case 'psbch_V2X'
            u_slts = mod(floor(n_ID/16),30) * ones(1,2);
        case 'psbch_D2D'
            u_slts = mod(floor(n_ID/16),30) * ones(1,2);
        case 'psdch'
            u_slts = zeros(1,2);
        case 'pssch_D2D'
            %perform Group hopping (only option for pssch)
            n_s = 2;
         	u_slts = mod(Function_Generate_gh_Sequence(Mode, n_ID, n_s) + mod(n_ID,30), 30);
            % IMPORTANT: Didn't validate with matlab!!!!
        case 'pssch_V2X'
            %perform Group hopping (only option for pssch)
            n_s = 2;
            u_slts = mod(Function_Generate_gh_Sequence(Mode, n_ID, n_s) + mod(floor(n_ID/16),30), 30);
        case 'pscch_D2D'
            u_slts = zeros(1,2);
        case 'pscch_V2X'
            u_slts = [8,8];
        case 'pusch'
            D_ss = SeqGroup;
            if(n_ID>0)
                D_ss = 0;  % is virtual cell ID, override given D_ss
            else
                n_ID = NCellID;
            end
                
            if strcmp(Hopping, 'Group')
                u_slts = mod(Function_Generate_gh_Sequence(n_ID) + mod(n_ID + D_ss,30), 30);
            else
                u_slts = mod(n_ID + D_ss,30) * ones(1,2);
            end
    end